package com.example01;

/**
 * Created by yangjun on 2018/3/22.
 */
public class HumanFactory extends AbstractHumanFactory {

    @Override
    public <T extends Human> T createHuman(Class<T> c) {
        Human human = null;
        try {
             human = (T)Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            System.out.println("人种生成失败");
        }
        return (T)human;
    }
}
